﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OgilvyOne.UKNow.Mobile.Utilities
{
    public class ResultUtility
    {
        public static string ReturnResultJson(string errcode, string datastr, string sucMsg)
        {
            string e = "\"e\":" + errcode;
            string d = "\"d\":" + ((datastr.Trim().Length==0) ? "\"\"" : datastr.Replace("\\/", "/"));
            string w = String.Format("\"w\":\"{0}\"", sucMsg);
            return "{" + String.Format("{0},{1},{2}", e, d, w) + "}";
        }
    }
}
